package me.zhengjie.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnVo {
    private Integer code;

    private String message;


    private Object data;


    public static ReturnVo OK(Object taskCode){
        ReturnVo returnVo = new ReturnVo();
        returnVo.setCode(200);
        returnVo.setMessage("成功");
        returnVo.setData(taskCode);
        return returnVo;
    }

    public static ReturnVo OK(){
        ReturnVo returnVo = new ReturnVo();
        returnVo.setCode(200);
        returnVo.setMessage("成功");
        return returnVo;
    }

    public static ReturnVo ng(String taskCode){
        ReturnVo returnVo = new ReturnVo();
        returnVo.setCode(500);
        returnVo.setMessage(taskCode);
        returnVo.setData(null);
        return returnVo;
    }
}
